<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="这是一个 adminInfoAdd 页面">
<meta name="keywords" content="adminInfoAdd">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<title>新增手机</title>
    
<link rel="icon" type="image/png" href="${basePath}static/adminManager/assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed" href="${basePath}static/adminManager/assets/i/app-icon72x72@2x.png">
<link rel="stylesheet" type="text/css"href="${basePath}static/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"href="${basePath}static/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css" />
<link rel="stylesheet" media="screen" href="${basePath}static/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" >
<link rel="stylesheet" href="${basePath}static/adminManager/assets/css/amazeui.min.css" />
<link rel="stylesheet" href="${basePath}static/adminManager/assets/css/admin.css">
<link rel="stylesheet" href="${basePath}static/adminManager/add/css/add.css">


</head>

<body>

	<div class="admin-biaogelist">
	
   		<div class="listbiaoti am-cf">
      		<ul class="am-icon-flag on"> 商品新增</ul>
      		<dl class="am-icon-home" style="float: right;">当前位置： 首页 > <a href="#">商品新增</a></dl>
    	</div>
    	
<div class="am-g tpl-g" >
	<div class="tpl-login">
		<div class="tpl-login-content">
		
			<form   id="form00" class="form-horizontal"  action="PhoneAddWithFile" 
				enctype="multipart/form-data"  method="post">
				
				<div  class="registe-content">
					
					<div class="bootint">
						<span class="input-span-text ">手机名称</span>
						<input type="text" class="form-control3" id="phonename"
							name="phonename" placeholder="请输入手机名称">
					</div>
				
					<div class="bootint">
						<span class="input-span-text ">手机价格</span>
						<input type="text" class="form-control3" id="phoneprice"name="phoneprice" 
							placeholder="请输入手机价格">
					</div>
				
					<div class="bootint">
						<span class="input-span-text ">手机库存</span>
						<input type="text" class="form-control3" id="phoneamount"name="phoneamount" 
							placeholder="请输入手机库存">
					</div>
					
					<div class="bootint">
						<span class="input-span-text ">手机详情</span>
						<input type="text" class="form-control3"  id="phonedescription" name="phonedescription" 
							placeholder="请输入手机详细介绍">
					</div>
				
					<div class="bootint">
						<span class="input-span-text ">购买链接</span>
						<input type="text" class="form-control3" id="phoneurl"name="phoneurl" 
							placeholder="请输入商品的购买链接">
					</div>

			<div class="bootint">
				<!-- 因为springmvc框架中，文件流对象，需要单独进行映射，不能直接映射给实体类；
						所有，文件表单控件name属性按一下规范命名：前缀_实体类属性名；
						例如：file_phoneimg（注意file_在文件上传时是固定的） 
						目的：防止文件流对象内容直接映射给实体类的属性-->
				<span class="input-span-text ">手机图片</span>	
				<input type="file" class="form-control3" id="phoneimg"name="file_phoneimg" > 
			</div>
				
			<div class="bootint" style="margin-bottom:30px">
				<button type="submit" class="btn btn-success btn-lg"  id="rebtn"onclick="return checkMe()">提交</button>
				<button type="reset" class="btn btn-info btn-lg" style="float:right">重置</button>	
			</div>
			
				</div>
			
        	</form>
            
		</div>
	</div>
 </div>


</div>
    

</body>
    
<script type="text/javascript" src="${basePath}static/jquery-1.12.4/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="${basePath}static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${basePath}static/layer-v3.1.1/layer/layer.js"></script>
<script type="text/javascript" src="${basePath}static/layui-v2.4.5/layui/layui.js"></script>
<script type="text/javascript">
	 // 验证form表单是否合法
	function checkMe() {
		// 错误提示信息
		var strMsg = "";
		// 手机名称验证
		var phonename = document.getElementById("phonename").value;
		if (phonename == null || phonename == "") {
			// 增加提示信息
			strMsg += "请输入用户名!<br>";
		}
		// 手机价格验证
		var phoneprice = document.getElementById("phoneprice").value;
		if (phoneprice == null || phoneprice == "") {
			// 增加提示信息
			strMsg += "请输入手机价格!<br>";
		}
		// 手机库存验证
		var phoneamount = document.getElementById("phoneamount").value;
		if (phoneamount == null || phoneamount == "") {
			// 增加提示信息
			strMsg += "请输入手机库存 !<br>";
		}
		// 手机详情验证
		var phonedescription = document.getElementById("phonedescription").value;
		if (phonedescription == null || phonedescription == ""	) {
			// 增加提示信息
			strMsg += "请输入手机详情!<br>";
		}
		// 手机购买链接验证
// 		var phoneurl = document.getElementById("phoneurl").value;
// 		if (phoneurl == null || phoneurl == ""	) {
// 			// 增加提示信息
// 			strMsg += "请输入手机购买链接!<br>";
// 		}
		// 手机图片验证
		var phoneimg = document.getElementById("phoneimg").value;
		if (phoneimg == null || phoneimg == ""	) {
			// 增加提示信息
			strMsg += "请选择手机图片!<br>";
		}
		
		// 判定整个表单是否可以进行提交
		if (strMsg == "") {
			// 验证通过
			return true;
		} else {
			// 验证不通过
			layer.open({
				icon:2,
				title : '提示',
				content : strMsg
			});
			return false;
		}
	}
	// 手动提交form表单
	function doSubmit() {
		document.getElementById("form00").submit();
	}
</script>


</html>